import re
import time
import pytest
from selenium.webdriver.common.by import By

from Auto.day02.login.Login_Operation import Login_Operation

class tTest_Alert_Location(Login_Operation):
    def ttest_alert_btn(self,login_driver):
        self.logins(login_driver)
        login_driver.get("http://localhost:90/user/tools/toApplyLoan.html")
        time.sleep(1)
        # 借贷金额//*[@id="amount"]
        login_driver.find_element(By.XPATH, '//*[@id="amount"]').send_keys(10000)
        # 借贷天数
        login_driver.find_element(By.XPATH, '//*[@id="term"]').send_keys(10)
        # 申请
        login_driver.find_element(By.XPATH, '//*[@id="submit"]').click()

        time.sleep(1)

        # 弹窗
        alert = login_driver.find_element(By.XPATH,"//div[@class='jconfirm-buttons']//button[@class='btn btn-primary']")
        print(alert.text)
